package zhcms.framework;
import java.util.*;
public class GySplit {
	@SuppressWarnings("rawtypes")
	private Vector v;
	
	@SuppressWarnings("rawtypes")
	public GySplit()
	{
		this.v=new Vector();
	}
	
	@SuppressWarnings("unchecked")
	public void tool(String str, String split)
	{
		String str1=new String();
		String str2=new String();
		if(str.length()<=0)
		{
			
		}
		else
		{
			//查找split的位置
			int position;
			position=str.indexOf(split);
			if(position==-1)
			{
				//只有一个
				this.v.add(str);
			}
			else
			{
				//进行分割
				str1=str.substring(0,position);
				str2=str.substring(position+split.length(),str.length());
				this.v.add(str1);
				tool(str2,split);
			}
		}
		//StringTokenizer st = new StringTokenizer(str,split,false);
		//while( st.hasMoreElements() ){
		//	System.out.println( st.nextToken() );
		//	this.v.add(st.nextToken());
		//}
	}

	public String[] Show()
	{
		String array[];
		array=new String[this.v.size()];
		for(int i=0;i<array.length;i++)
		{
		array[i]=new String((String)v.elementAt(i));
		}
		return array;
	}
}
